package com.dragon.repository.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dragon.repository.entity.VendorBill;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 供应商账单 Mapper 接口
 * </p>
 *
 * @author sy
 * @since 2023-12-29
 */
@Mapper
public interface VendorBillMapper extends BaseMapper<VendorBill> {

    /**
     * 分页列表sql
     * @param vBillPage
     * @param wrapper
     * @return
     */
    @Select("select dvb.*, dv.name as vendorName from dragon_vendor_bill dvb " +
            "left join dragon_vendor dv on dv.id = dvb.vendor_id " +
            "${ew.customSqlSegment}")
    Page<VendorBill> selectDetailPage(Page<VendorBill> vBillPage,  @Param(Constants.WRAPPER) QueryWrapper<VendorBill> wrapper);
}
